import { createRouter, createWebHashHistory } from "vue-router";

const routes = [{
        path: '/',
        name: "login",
        component: () =>
            import ("../views/Login.vue")
    },
    {
        path: "/Main",
        component: () =>
            import ("../views/Main.vue"),
        name: 'main',
        redirect: "./home",
        children: [{
            path: "/home",
            meta: { name: "系统首页" },
            name: "home",
            component: () =>
                import ("../views/home/Home.vue")
        }, {
            path: '/info',
            name: "info",
            meta: { name: "个人信息" },
            component: () =>
                import ("../views/home/PersonInfo.vue")
        }, {
            path: '/password',
            name: 'password',
            meta: { name: '修改密码' },
            component: () =>
                import ("../views/home/password.vue")
        }, {
            path: '/user',
            name: 'user',
            meta: { name: '用户管理' },
            component: () =>
                import ("../views/User.vue")
        }]
    },
    {
        path: '/register',
        name: "register",
        component: () =>
            import ("../views/Register.vue")
    },

]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router;